The invention relates generally to software applications and, more particularly, to methods and apparatus for managing resource usage in an object-based system.
In the consumer field, there is intense pressure to keep costs down. Thus, the capabilities of memory and CPU devices within consumer systems, for example, are scaled down as much as possible to minimize overall costs. For example, cable television set top boxes typically include limited memory space and CPU capabilities. As object-based systems are integrated within consumer devices, it is becoming more important to manage resource usage effectively within the object-based systems. In other words, as a result of limited resources (among other reasons), a major issue within the object-oriented field is how to track and manage resource usage.
In the JavaOS platform, the virtual machine is configured to classify resource availability into three states: RED, YELLOW and GREEN. Additionally, the virtual machine tracks resource availability, such as available Java heap space. If resource availability is within acceptable limits, resource availability is classified as being in GREEN mode. If a resource is reaching an unacceptable level of availability, resource availability is then classified as being in YELLOW mode. When in YELLOW mode, a request is sent to all applications to lower their resource usage. The notified applications are all expected to free up resources. If resource availability becomes worse (e.g., applications are not freeing up enough resources), the system can then go into a RED state. A RED state may indicate that one or more applications or other resource-consuming entities must be terminated to make resources available. As resources became available, the system can be put back into GREEN mode.
Although this conventional resource management scheme works well in some environments, it tends to be inefficient in systems in which multiple applications are simultaneously executing. When the multiple applications receive a request to lower their resource consumption, all of the applications may simultaneously begin freeing up resources. This conventional resource management schemes does not differentiate between applications. That is, all applications receive a same request to lower resource usage. Thus, a lower priority application may not necessarily lower its resource usage prior to a higher priority application lowering its resource usage. Additionally, an application that is using a disproportionate amount of resources may not relinquish its resources before several other applications that are minimally using resources relinquish all of the their resource usage and self-terminate. These scenarios are inefficient at best. Additionally, the virtual machine does not know the specifics of individual resource usage by each application.
Accordingly, there is a need for improved mechanisms for efficiently managing resource usage by applications based on each individual application's resource usage characteristics or any other suitable criteria.